package com.github.wxiaoqi.security.common.exception;

import lombok.Data;

/**
* @author: bolei
* @date：2018年5月18日 下午5:06:19 
* @description：https://juejin.im/post/5a93bb835188257a7b5ab9a4
*/

@Data
public class ApiException extends RuntimeException{
	
	private static final long serialVersionUID = 1L;
	protected String code ;
	protected String message ;
	protected Object data ;
	private String success;

	public ApiException(String code,String message,Object data,Throwable e){
	    super(message,e);
	    this.code = code ;
	    this.data = data ;
	}

	public ApiException(String errorCode,String message,Object data){
	    this(errorCode,message,data,null);
	}

	public ApiException(String code,String message){
	    this(code,message,null,null);
	}

	public ApiException(String message,Throwable e){
	    this(null,message,null,e);
	}

	public ApiException(){

	}

	public ApiException(Throwable e){
	    super(e);
	}


}
